import os
from datetime import timedelta

# =============================================== 数据库配置 =================================================
HOSTNAME = 'localhost'
PORT = 3306  # 注意这里是整数类型，不是字符串了
USERNAME = 'root'
PASSWORD = '123456'
DATABASE = 'watermarkremoval'

# 使用 f-string 格式化 DB_URI
DB_URI = f'mysql+pymysql://{USERNAME}:{PASSWORD}@{HOSTNAME}:{PORT}/{DATABASE}?charset=utf8'
SQLALCHEMY_DATABASE_URI = DB_URI

# =============================================== 基础配置 =================================================
# 设置一个密钥来加密 session 数据
SECRET_KEY = 'cwjdsz'
# 设置一个密钥来加密 token数据
JWT_SECRET_KEY='cwjcjdsz'
#设置token有效时间
JWT_ACCESS_TOKEN_EXPIRES=timedelta(hours=48)

#设置上传图片路径
UPLOAD_FOLDER = os.path.join('static', 'uploads')
#设置返回图片路径
PROCESSED_FOLDER = os.path.join('static', 'processed')